package day7zy;

import java.util.Scanner;

public class Jsq {
    String color;
    String pp;
    int jg;
    public double cheng(double c,double d){
        return c*d;
    }
    public double chu(double c,double d){
        return c/d;
    }
    public double jia(double c,double d){
        return c+d;
    }
    public double jian(double c,double d){
        return c-d;
    }
    public double lifang(double c){
        return c*c*c;
    }
}
class sq extends Jsq {
    public static void main(String[] args) {
        sq js = new sq();
        js.color = "天蓝色";
        js.jg = 100;
        js.pp = "得力";
        int choice = 0;
        Scanner in = new Scanner(System.in);
        while (true) {
            System.out.println("请选择：");
            System.out.println("1:加法\n2:减法\n3:乘法\n4:除法\n5:立方");
            choice = in.nextInt();
            switch (choice) {
                case 1: {
                    System.out.print("输入两个数：");
                    double a = in.nextDouble();
                    double b = in.nextDouble();
                    double he = js.jia(a,b);
                    System.out.println("和为：" + he);
                }
                break;
                case 2: {
                    System.out.print("输入两个数：");
                    double a = in.nextDouble();
                    double b = in.nextDouble();
                    double cha = js.jian(a,b);
                    System.out.println("差为：" + cha);
                }
                break;
                case 3: {
                    System.out.print("输入两个数：");
                    double a = in.nextDouble();
                    double b = in.nextDouble();
                    double ji = js.cheng(a,b);
                    System.out.println("积为：" + ji);
                }
                break;
                case 4: {
                    System.out.print("输入两个数：");
                    double a = in.nextDouble();
                    double b = in.nextDouble();
                    double shang = js.chu(a,b);
                    System.out.println("商为：" + shang);
                }
                break;
                case 5: {
                    System.out.print("输入一个数：");
                    double a = in.nextDouble();
                    double lifang = js.lifang(a);
                    System.out.println("立方为：" + lifang);
                }
                break;
            }
        }
    }
}